home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BindngH.h
-
- Contains: Class definition for Binding helper object
-
- Owned by: Caia Grisar
-
- Copyright: © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <4> 6/27/96 RA 1343748: Added fSelf to BindingH.h so
- Binding can call back to ODBinding
- <3> 6/21/96 RA 1360591: Changed viewer NS type from object
- to value
- <2> 1/8/96 CG 1299331 1.0.1: Substitution warning dlg
- nolonger displayed in background.
- <5> 8/30/95 CG #1244563 FB1:Missing editor needs
- explanatory alert
- #1215054 FB: Too many substitute editor
- dialogs
- <4> 6/16/95 CC 1259719: Added ChangeEditor and
- ChangeKindAndEditor.
- <3> 5/18/95 CG #1249263 BB: BndNSUtl.cpp does not compile
- standalone.
- <2> 4/27/95 CC 1243813: Removed ShowAlert and
- BindingDialogFilter; replaced by ShowAlert
- in DlogUtil.
- <1> 4/13/95 CG first checked in
- <8> 12/13/94 CG #1193522: Added Binding Alert.
- <7> 8/24/94 CG #1181622: Updated ownership info.
- <6> 8/17/94 CG #1181440: ViewNameSpace now return
- ODObjectNameSpace. Made methods
- nonvirtual.
- <5> 7/29/94 CG NameSpace API changes.
- <4> 7/26/94 jpa Don't inherit from ODObject.
- <3> 6/27/94 CG Moved IsEditorLoaded here from Prefs,
- Removed fEv
- <2> 6/23/94 eeh remove EditorSet and ODEditorSetIterator
- <1> 6/15/94 CG first checked in
- <1> 6/1/94 CG first checked in
- <14> 5/27/94 CG #1165186: Abstracted out preferences from
- Binding object.
- <13> 4/13/94 TÇ #1147222: Fix the View As popup in the Part
- Frame Info dialog. Also fix the Category
- text, and the Kind & Editor popups to show
- the current kind & editor respectively.
- Made one method public for PtFrInfo.cpp to
- use.
- <12> 4/4/94 CC GetKindsSupported() and
- GetCategoriesOfKind() return ODTypeList
- (1153046).
- <11> 3/26/94 NP 1152831. Move private functions here.
- <10> 3/23/94 CG Added VerifyPrefFileVersion() and
- UpdatePrefFileVersion() private methods.
- <9> 3/15/94 MB Changes to support SCpp/ASLM builds,
- #1150864.
- <8> 3/14/94 CC Added GetCurrentEditorForPart() (#1150376);
- Made EditorSupportsKind() and
- GetKindsSupported() public for
- LinkDlgs.cpp.
- <7> 3/11/94 CG Bug # 1150204 - NMAPs are now loaded
- whenever mod date of registered library
- folder changes.
- <6> 2/17/94 eeh bug #1143340: made various private methods
- public (to call from EdPrfInf.cpp)
- <5> 2/3/94 CG Added fHeap field.
- <4> 1/12/94 CG Removed ODCategorySet.
- <3> 12/16/93 TÇ moved typedef of ODEditor to PlfmType.h
- <2> 12/10/93 CG Added ASLM class id definition for the
- ODBinding object.
- <1> 11/7/93 TÇ first checked in
- To Do:
- */
-
- #ifndef _BINDNGH_
- #define _BINDNGH_
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- #ifndef _ODOBJ_
- #include "ODObject.xh"
- #endif
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- //=====================================================================================
- // Theory of Operation
- //=====================================================================================
-
- /*
- This file describes the ODBinding class.
- ODBinding is a system service that is used to bind part data to part editors.
- ODBinding also includes a number of utility functions, including mapping content
- kinds to categories, providing a list of part editors supporting a given kind, and
- routines to access and set system-wide editor preferences.
- */
-
-
- //=====================================================================================
- // Classes defined in this interface
- //=====================================================================================
- class Binding;
-
- //=====================================================================================
- // Classes used by this interface
- //=====================================================================================
- class ODStorageUnit;
- class ODDraft;
- class ODTypeList;
- class ODSession;
- class ODObjectNameSpace;
- class ODNameSpaceManager;
- class ODValueNameSpace;
- class OrderedCollection;
- class OrderedCollectionIterator;
- class ODFile;
- class EditorSet;
- class ODPart;
- class ODBinding;
-
- //==============================================================================
- // function prototypes
- //==============================================================================
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #pragma lib_export on
-
- ODBoolean IsNoPart(Environment* ev, ODPart* rootPart);
- ODEditor GetCurrentEditorForPart(ODPart* part );
- void ChangeEditor(ODPart* part, ODEditor editorID);
- void ChangeKindAndEditor (Environment *ev,
- ODPart* part,
- ODType newKind,
- ODEditor newEditor,
- ODNameSpaceManager* nsm);
-
- #pragma lib_export off
-
- #ifdef __cplusplus
- }
- #endif
-
- //=====================================================================================
- // Class Binding
- //=====================================================================================
-
- class Binding
- {
- public:
-
- Binding();
-
- // ODSession creates one instance of Binding
- // which is then shared among clients within the process.
-
- ODVMethod ~Binding();
-
- ODNVMethod void InitBinding(ODSession* session);
-
- ODNVMethod ODSize Purge(ODSize size);
-
- //---------------------------------
- // Direct editor bindings
-
- ODNVMethod ODEditor ChooseEditorForPart(ODStorageUnit* thePartSU, ODType newKind );
- // Returns the "best" available editor for the part
- // may invoke automatic translation
-
- ODNVMethod ODEditor TranslateAndChooseEditorForPart(ODStorageUnit* thePartSU);
- // attempt to intelligently translate one of the kinds in the part into
- // a kind which an available editor supports, and return that editor
-
- //---------------------------------
- // Editor related utility methods
-
- ODNVMethod ODTypeList* GetKindsSupported(ODEditor editor);
- // Returns the set of data types supported (without translation) by the
- // argument editor.
-
- ODNVMethod ODContainerSuite GetContainerSuite(ODContainerType containerType);
-
- ODNVMethod ODBoolean EditorExists(ODEditor editor);
- // Returns true if the argument editor is present on this machine.
-
- ODNVMethod ODBoolean IsEditorLoaded(ODEditor editor);
- private:
-
- ODNVMethod ODEditor ChooseDirectEditorForPart(ODStorageUnit* thePartSU, ODType newKind );
- // Returns the "best" available editor for the part
- // without translation.
-
- ODNVMethod ODEditor ChooseDirectEditorForKind(ODType aKind, ODStorageUnit* thePartSU);
- // Returns the "best" available editor which supports kind aKind of the part
- // without translation.
-
- //---------------------------------
- // Editor related utility methods
-
- ODNVMethod ODEditor GetPreferredEditorForPart(ODStorageUnit* thePartSU, ODBoolean* noPrefEditor);
- // Returns the editor that last externalized the argument storage unit.
- // Null is returned if that editor is not present on the current machine.
- // noPrefEditor is set to true if no kODPropPreferredEditor property exists in the SU
-
- ODNVMethod ODEditor AlphaNumChooseEditor(EditorSet* editorSet);
- // Returns the (alphanum preferred editor over viewer) from
- // the set of Editors
-
- ODNVMethod ODEditor AlphaNumChooseAnEditorFromTwo(ODEditor e1, ODEditor e2);
- // Returns the (alphanum preferred editor over viewer) of the two editors
-
- ODNVMethod ODBoolean DraftRestrictsEditors(ODDraft* draft);
- // Returns true if the argument draft restricts the editors that may be
- // used in this document.
-
- ODNVMethod EditorSet* GetAllRestrictedEditorsForKind(ODDraft* draft, ODType kind);
- // returns subset of restricted editors of draft which support kind.
-
- //---------------------------------
- // Category and kind mappings
-
- ODNVMethod ODValueNameSpace* ViewerNameSpace();
-
- //---------------------------------
- // Alert Utilities
- ODNVMethod void SubstitutionWarning(ODEditor theEditor, ODStorageUnit* thePartSU);
-
- ODNVMethod ODBoolean NotifiedSubstitutions(ODEditor theEditor,
- ODISOStr theCategory);
-
-
- // Fields:
-
- ODSession* fSession;
- ODValueNameSpace* fSubstitutionList;
- NMUPP fNMResponseUPP;
- NMRecPtr fNMRecPtr;
- ODBinding* fSelf;
- };
-
-
- #endif // _BINDNGH_